tsrpfandomcom-20200214-history
Configuring ARP
=File Structure= All configurable Apollo RP files are contained in the ./configs/arp/ directory. ARP uses a special system to handle map configuration file loading. Based largely on the "ARP_FileOpen" native, the core attempts to load configuration files from the map (./configs/arp/maps//) directory. Failing that, it loads from the ARP configuration directory (./configs/arp/). The only file that doesn't follow this rule is the "arp.ini" file, which actually loads from both if they are both present. This file is first loaded from the ARP base configuration directory, then any settings contained in the map configuration directory overwrite those previously loaded. =SQL Connection Settings= The SQL connection settings are stored in the file "arp.ini". The default settings are as follows: arp_sql_host "localhost" arp_sql_user "root" arp_sql_pass "" arp_sql_db "arp" arp_sql_type "mysql" arp_table_users "arp_users" arp_table_property "arp_property" arp_table_doors "arp_doors" arp_table_items "arp_items" arp_table_keys "arp_keys" arp_table_jobs "arp_jobs" These can be modified in-game using the configuration (ARP_Config) plugin. =Game Settings= Most game settings can be found in the "arp.cfg" file, located in ./configs/arp/. All CVARs and commands in it contain an explanation directly above them for what the CVAR or command does and what parameters it takes. =Access Flags= Access flags in ARP work much differently from those in HWRP or any other plugins. Instead of a string that must be matched letter by letter to another in order to be considered inclusive (i.e. MCPD = MCPD), the flag system in ARP treats each letter of the alphabet as a separate flag. For example, if a user has flags "ac" and the police flag is "a", then they are considered a police officer on top of whatever flag "c" is assigned to. This allows players to be part of multiple factions or use multiple plugins that require a certain level of access to use them. Flags in ARP are divided into two sections and two sections only: access flags and job access flags. A player gathers access flags from two sources: independent access flags, job access flags. A player can only gather job access flags from a single source: their independent job access flags. Independent access flags are assigned using the "arp_setaccess" command. The player does not lose these flags unless the "arp_setaccess" command is run on them again without the flag assigned as one of the parameters. Job access flags are assigned to a user from their job. For example, a job like "MCPD Explorer" might have flag "a". If the user has the job "MCPD Explorer" and the command "arp_setaccess" is run on them such that they have flag "a", the flags do not stack. The player will still simply have flag "a", but if they lose their job, they will still have flag "a" because it was assigned to them using "arp_setaccess". Job access flags are, by default, assigned to allow players to hand out jobs that have a certain flag. For example, if a player has job access flag "a", that means that they can employ people to any job containing flag "a" (police officers, FBI or similar organizations). By default, the police access flag is "a", the medical access flag is "b" and the admin access flag is "z". These can all be edited in the "arp.cfg" file. =Properties= ARP uses a completely different property system than that in HWRP or any other plugins. Properties are divided into two different sections: properties and doors. While the door is the physical manifestation, the property is simply the concept. It contains all of the details, such as price, locked status, owner, name, etc. The door is a location that a property is present at. Properties and doors are linked using an "internal name", which is simply a tag for that property. It can be anything, although it is recommended that it is something easy to remember, like "md" for "Medical Department". Addition Properties can be added through the "arp_addproperty" command. Any parameter that is to be left blank should be inputted as "". The command takes the following parameters: * - tag used to link to doors * - the name as it is to appear for users looking at a door linked to the property * - the name of the owner * - the authid of the owner * - how much it is to be sold for (0 to indicate not for sale) * - whether or not to lock it (0 or 1) * - what access flags should have access to it * - how much profit it has A door can then be linked to it by running "arp_adddoor". This command has only one parameter: the internal name of the property it is to be added to. Editing Properties can be edited using the "arp_setproperty" command. This command is nearly identical to the "arp_addproperty" command, although it differs in two ways: *The internal name parameter is not used to edit the property; it is used to reference it. *Parameters that are not to be changed should be set to "!". For example, if you want to change only the locked status of a property, you should type: arp_setproperty ! ! ! ! 1 ! ! Doors cannot be edited. If you want to move a door to another property, you should delete that door then re-add it to another property. Deleting Properties and doors can be deleted using the "arp_deleteproperty" and "arp_deletedoor" commands. Both of these commands require you only to look at a door linked to a property for them to take effect. =NPCs= NPCs are organized in the "npcs.ini" file found in the map directory for the map being run. There are 5 different types of NPCs by default: shops, doctors, banks, atms and gunshops. The following is an example entry in npcs.ini: type "shop" name "Wawa Clerk" model "models/mecklenburg/chef.mdl" angle "180" origin "-2374 1210 -445" sell "Cigarette 10" sell "Cuban_Cigar 20" sell "Tobacco_Pipe 30" sell "Lighter 10" sell "Zippo 50" sell "Spray_Can 50" property "seveneleven" robprofile "Wawa" END The "type" parameter is used to determine which type of NPC it should be. The "name" parameter indicates what it should appear as when looked at. The "model" parameter is the model that should be used if the NPC is not a zone (this will be covered later). The "angle" parameter indicates which direction the NPC should be facing. The "origin" parameter indicates where in the game world the NPC should be located. Using "sell" tells the NPC to sell an item with a given name and price. Underscores are used to replace spaces in the configuration file. The "property" parameter is the property it should be linked to in order to enable profit gathering. Finally, the "robprofile" parameter is used to indicate which profile specified in rob.ini should be called when the NPC is robbed. This is all ended with the "END" command, which spawns the NPC. In addition to these, a line containing the word "zone" can be added to turn the NPC into a zone. Zones are used when there is an area with which an invisible and incorporeal NPC is needed. For example, a gunshop with an NPC behind glass or an ATM would need a zone-based NPC. When a zone is used, the "model" and "angle" parameters are ignored. Shops These are the most generalized of the NPCs. They are used to sell items and be robbed. They take no additional parameters. Doctors Doctors act like shops, except they cannot be robbed and they have an optional "!Heal" parameter which, when used, begins the heal process. To use this, input a "sell" command with item id "!Heal" and any price. For example, sell "!Heal 100". Banks Banks allow users to buy ATM cards, withdraw/deposit money and rob. They cannot sell items and do not gather profit. ATMs ATMs are essentially portable banks. The use of them requires an ATM card. They allow users to withdraw/deposit money. They cannot be robbed, cannot sell items and do not gather profit. Gunshops Gunshops are shops specializing in selling guns. They can take an additional "addgun" command. The "addgun" command is the same as "sell", except that it has a 3rd parameter which allows you to specify a license that a player must have to buy the item. The licenses are as follows: *0 - non-restricted: this is the most basic license and tends to cost very little as it includes only basic guns *1 - restricted: this is the next license which includes most mid-range weapons *2 - prohibited: these guns cannot be bought at a gun store and are generally the most dangerous Here is an example usage of "addgun": addgun "glock-18 1000 0" Gunshops cannot be robbed, do not gather profit and cannot sell items that aren't declared using "addgun". ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, =Jail Settings= The jail plugin contains all of the functionality for jailing and cuffing - essentially the most important things for the police force. Jail origins are specified in the map directory, inside the file "jailmod.ini". Here is an example entry: One origin "-2724 2214 -347" command "1" The "Jail One" section declares the name of the jail as it is to appear in the menu, which can be called up in-game with the command "jailmodmenu" in the console. The "origin" is where a player should be sent if they are jailed to this location. The "command" parameter declares the quick-command that can be used for binding and console access. The command to use this jail is always "jail " in the console. In this case, it would be "jail 1". By default, cuffing requires the "Cuff" item, which is used up when someone is cuffed, then given back when they are uncuffed. This functionality can be disabled by opening the "ARP_JailMod.sma" file, putting "//" in front of "#define CUFF_ITEM", then recompiling and copying the new binary over to the server. =Rob Settings= Rob Mod uses a light-weight scripting engine called RobScript, which was developed for ARP. With some changes, it can be used for other purposes including hacking, an alarm system and many other applications. RobScript sections are divided into "profiles", generally for each location that is to be robbed. There are two types of "commands" in RobScript: *Configuration lines **These allow you to configure the messages and settings of a certain place. Their structure is: command "parameter" *Execution lines **These allow you to run a sequence of events. Their structure is: !command "parameter" See RobScript for more details on configuration. =Backwards Compatibility Layer= ARP comes with a backwards compatibility layer designed to allow HWRP items to be run on the new items platform. Although most items have been ported to ARP already, those that do not access the SQL database themselves can be run through the backwards compatibility layer. The backwards compatibility layer is managed through the "bcompat.ini" file, found in the ./configs/arp/ directory. The parameters for each line are as follows: An example entry is as follows: 1336 "Weed" "item_weed_smoke " 1 The "itemid" is usually specified by the author of the item. If it isn't, you can use any arbitrary number. The "name" is usually irrelevant and is simply whatever you want it to be called. The "command" parameter declares the command as it appears in the items table for HWRP. Usually this is given by the item author. "useup" declares whether or not the item should decrease in quantity when used. =Weapon Spawns= The command to add a weapon spawn is "arp_addgun " * is the weapon id of the gun * is the amount of ammo the gun should spawn with * is a bit value containing the properties of the weapon spawn **1 - Silencer **2 - Lasersight **4 - Flashlight **8 - Scope **16 - Position weapon on wall rather than floor **Note: Add these up, don't put "1,2,4,..." * determines whether or not the spawn should stay on map change/server restart/etc. Weapons IDs: 1 - Glock 18 3 - Mini Uzi 4 - Benelli M3 5 - M4A1 6 - MP5SD 7 - MP5K 8 - Beretta 9 - SOCOM Mk23 11 - USAS-12 12 - Desert Eagle 13 - Ak47 14 - Five-seveN 15 - Steyr Aug 17 - Skorpion 18 - Barrett M82 19 - HK PDW 20 - SPAS-12 21 - Akimbo Colts 22 - Glock 20 23 - UMP 25 - Combat Knife 26 - Mossberg 500 27 - M16A4 28 - Ruger Mk1 24 - M61 Grenade 31 - Raging Bull 32 - M60 33 - Sawed-off 34 - Katana 35 - Seal Knife 36 - Contender =Plugins= Installing Often, plugins will have their own directions if they need special installation requirements. However, this will instruct you on the basics of adding a plugin. #Follow any directions the plugin author has given you. If the plugin requires extra steps or special files, make sure you have them in the proper place and order. #If you are given a .sma source file instead of a .amxx, you must compile the plugin yourself. For more information, see Compiling Plugins. #Place the plugin's .amxx file in the addons/amxmodx/plugins folder. #Add the plugin's name to addons\amxmodx\configs\plugins-arp.ini after the "3rd Party Plugins" line. Example: myplugin.amxx #Change map or restart the server. If the plugin has any load errors, see Troubleshooting Plugins. Removing #Remove the entry from addons\amxmodx\configs\plugins-arp.ini by deleting it or prepending a semi-colon to comment it out. #Delete any associated files. Default Plugins : Category:Articles